<template>
  <div class="ivu-box">
    <div class="form_box">
      <Form style="width: 850px;"  :label-width="100">
        <FormItem label="活动类型 : ">
          <RadioGroup value="first"  @on-change="autoMoney">
            <Radio label="first">固定额</Radio>
            <Radio label="second">比例返现</Radio>
          </RadioGroup>
        </FormItem>
        <div v-if="current1==='first'">
          <FormItem label="返现数额:">
            <Input type="text"   style="width: 200px;" value="100"></Input>
          </FormItem>
        </div>
        <div v-if="current1==='second'">
          <FormItem label="返现比例:">
            <Input type="text"   style="width: 200px;" value="40%"></Input>
          </FormItem>
        </div>
        <FormItem>
          <Button type="primary"  @click="remove(row)" style="margin-right: 10px"
          >提交保存</Button
          >
        </FormItem>
      </Form>
    </div>
  </div>
</template>
<script>
    export default {
      data () {
        return {
          current1: 'first',
          current2: '0'
          }
      },
      methods: {
        autoMoney(current1) {
          this.current1=current1;
        },
        // 下拉框选择后"增满"字和"元天"字的变化
        setWords(current2,value) {
          this.current2=current2;
          current2=value;
        },
        remove(row) {
          this.selectID = [];
          this.selectID.push(row.id)

          this.$Modal.confirm({
            title: '确定要删除账号:“' +  row.username + '”吗？',
            onOk: () => {
              this.axios.post("account/delAccount",{id:this.selectID}).then(res => {
                if(res.code == 1){
                  this.$Message.success("删除成功");
                  this.lists();
                }
              })
            },
            onCancel: () => {}
          });
        }
      }

    }
</script>

<style scoped>

</style>
